<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!-- style sheet of Vssue -->
<link rel="stylesheet" href="https://unpkg.com/vssue/dist/vssue.min.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>

<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<script src="https://unpkg.com/vssue/dist/vssue.gitee.min.js"></script>
<link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; --title-bar-height:20px; }
.mac-os-11 { --title-bar-height:28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  .typora-export #write { break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  .is-mac table { break-inside: avoid; }
  .typora-export-show-outline .typora-export-sidebar { display: none; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.6; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
  .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex:2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
  .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
  .typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: ""; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: ""; }
.outline-h1 > .outline-item { padding-left: 0px; }
.outline-h2 > .outline-item { padding-left: 1em; }
.outline-h3 > .outline-item { padding-left: 2em; }
.outline-h4 > .outline-item { padding-left: 3em; }
.outline-h5 > .outline-item { padding-left: 4em; }
.outline-h6 > .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open > .outline-item > .outline-expander::before { content: ""; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open > .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: "−"; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }
.md-inline-math-container mjx-container { zoom: 0.95; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; outline: 0px; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: auto hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 10px; z-index: 3; overflow-y: hidden; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; inset: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
span.cm-underlined { text-decoration: underline; }
span.cm-strikethrough { text-decoration: line-through; }
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
.cm-tw-deleted { text-decoration: line-through; }
.cm-tw-header5 { font-weight: 700; }
.cm-tw-listitem:first-child { padding-left: 10px; }
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
.cm-tw-underline { text-decoration: underline; }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}


:root {
    --side-bar-bg-color: #fafafa;
    --control-text-color: #777;
}

@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);

/* open-sans-regular - latin-ext_latin */
  /* open-sans-italic - latin-ext_latin */
    /* open-sans-700 - latin-ext_latin */
    /* open-sans-700italic - latin-ext_latin */
  html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: "Open Sans","Clear Sans", "Helvetica Neue", Helvetica, Arial, 'Segoe UI Emoji', sans-serif;
    color: rgb(51, 51, 51);
    line-height: 1.6;
}

#write {
    max-width: 860px;
  	margin: 0 auto;
  	padding: 30px;
    padding-bottom: 100px;
}

@media only screen and (min-width: 1400px) {
	#write {
		max-width: 1024px;
	}
}

@media only screen and (min-width: 1800px) {
	#write {
		max-width: 1200px;
	}
}

#write > ul:first-child,
#write > ol:first-child{
    margin-top: 30px;
}

a {
    color: #4183C4;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    line-height: 1.4;
    cursor: text;
}
h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
    text-decoration: none;
}
h1 tt,
h1 code {
    font-size: inherit;
}
h2 tt,
h2 code {
    font-size: inherit;
}
h3 tt,
h3 code {
    font-size: inherit;
}
h4 tt,
h4 code {
    font-size: inherit;
}
h5 tt,
h5 code {
    font-size: inherit;
}
h6 tt,
h6 code {
    font-size: inherit;
}
h1 {
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #eee;
}
h2 {
    font-size: 1.75em;
    line-height: 1.225;
    border-bottom: 1px solid #eee;
}

/*@media print {
    .typora-export h1,
    .typora-export h2 {
        border-bottom: none;
        padding-bottom: initial;
    }

    .typora-export h1::after,
    .typora-export h2::after {
        content: "";
        display: block;
        height: 100px;
        margin-top: -96px;
        border-top: 1px solid #eee;
    }
}*/

h3 {
    font-size: 1.5em;
    line-height: 1.43;
}
h4 {
    font-size: 1.25em;
}
h5 {
    font-size: 1em;
}
h6 {
   font-size: 1em;
    color: #777;
}
p,
blockquote,
ul,
ol,
dl,
table{
    margin: 0.8em 0;
}
li>ol,
li>ul {
    margin: 0 0;
}
hr {
    height: 2px;
    padding: 0;
    margin: 16px 0;
    background-color: #e7e7e7;
    border: 0 none;
    overflow: hidden;
    box-sizing: content-box;
}

li p.first {
    display: inline-block;
}
ul,
ol {
    padding-left: 30px;
}
ul:first-child,
ol:first-child {
    margin-top: 0;
}
ul:last-child,
ol:last-child {
    margin-bottom: 0;
}
blockquote {
    border-left: 4px solid #dfe2e5;
    padding: 0 15px;
    color: #777777;
}
blockquote blockquote {
    padding-right: 0;
}
table {
    padding: 0;
    word-break: initial;
}
table tr {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 0;
}
table tr:nth-child(2n),
thead {
    background-color: #f8f8f8;
}
table th {
    font-weight: bold;
    border: 1px solid #dfe2e5;
    border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
}
table td {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 6px 13px;
}
table th:first-child,
table td:first-child {
    margin-top: 0;
}
table th:last-child,
table td:last-child {
    margin-bottom: 0;
}

.CodeMirror-lines {
    padding-left: 4px;
}

.code-tooltip {
    box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
    border-top: 1px solid #eef2f2;
}

.md-fences,
code,
tt {
    border: 1px solid #e7eaed;
    background-color: #f8f8f8;
    border-radius: 3px;
    padding: 0;
    padding: 2px 4px 0px 4px;
    font-size: 0.9em;
}

code {
    background-color: #f3f4f4;
    padding: 0 2px 0 2px;
}

.md-fences {
    margin-bottom: 15px;
    margin-top: 15px;
    padding-top: 8px;
    padding-bottom: 6px;
}


.md-task-list-item > input {
  margin-left: -1.3em;
}

@media print {
    html {
        font-size: 13px;
    }
    table,
    pre {
        page-break-inside: avoid;
    }
    pre {
        word-wrap: break-word;
    }
}

.md-fences {
	background-color: #f8f8f8;
}
#write pre.md-meta-block {
	padding: 1rem;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f7f7f7;
    border: 0;
    border-radius: 3px;
    color: #777777;
    margin-top: 0 !important;
}

.mathjax-block>.code-tooltip {
	bottom: .375rem;
}

.md-mathjax-midline {
    background: #fafafa;
}

#write>h3.md-focus:before{
	left: -1.5625rem;
	top: .375rem;
}
#write>h4.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
#write>h5.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
#write>h6.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
.md-image>.md-meta {
    /*border: 1px solid #ddd;*/
    border-radius: 3px;
    padding: 2px 0px 0px 4px;
    font-size: 0.9em;
    color: inherit;
}

.md-tag {
    color: #a7a7a7;
    opacity: 1;
}

.md-toc { 
    margin-top:20px;
    padding-bottom:20px;
}

.sidebar-tabs {
    border-bottom: none;
}

#typora-quick-open {
    border: 1px solid #ddd;
    background-color: #f8f8f8;
}

#typora-quick-open-item {
    background-color: #FAFAFA;
    border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
    border-style: solid;
    border-width: 1px;
}

/** focus mode */
.on-focus-mode blockquote {
    border-left-color: rgba(85, 85, 85, 0.12);
}

header, .context-menu, .megamenu-content, footer{
    font-family: "Segoe UI", "Arial", sans-serif;
}

.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state{
    visibility: visible;
}

.mac-seamless-mode #typora-sidebar {
    background-color: #fafafa;
    background-color: var(--side-bar-bg-color);
}

.md-lang {
    color: #b4654d;
}

/*.html-for-mac {
    --item-hover-bg-color: #E6F0FE;
}*/

#md-notification .btn {
    border: 0;
}

.dropdown-menu .divider {
    border-color: #e5e5e5;
    opacity: 0.4;
}

.ty-preferences .window-content {
    background-color: #fafafa;
}

.ty-preferences .nav-group-item.active {
    color: white;
    background: #999;
}

.menu-item-container a.menu-style-btn {
    background-color: #f5f8fa;
    background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0)); 
}



</style><title>牛客网c/c++面经总结</title>
</head>
<body class='typora-export os-windows typora-export-show-outline typora-export-no-collapse-outline'><div class='typora-export-content'>
<div class="typora-export-sidebar"><div class="outline-content"><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#cc-基础">c/c++ 基础</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#操作系统">操作系统</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#内存管理">内存管理</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#进程">进程</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#线程">线程</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#文件系统">文件系统</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#中断">中断</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#组件">组件</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#数据库">数据库</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#计算机网络">计算机网络</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#数据结构与算法">数据结构与算法</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#设计模式">设计模式</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#编译原理">编译原理</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux">Linux</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#嵌入式">嵌入式</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#其他">其他</a></div><ul class="outline-children"></ul></li></div></div><div id='write'  class=''><p><span>vivo提秋招前批的开始，拉开了2021秋招的序幕，为了准备秋招，整理了牛客网上面关于</span><a href='https://www.nowcoder.com/discuss/experience?tagId=640&amp;order=3&amp;companyId=0'><span>c/c++面经合集</span></a><span>从2020-04-27到2020-06-09的相关面试问题的整理，后面将持续更新。</span></p><hr /><div class='md-toc' mdtype='toc'><p class="md-toc-content" role="list"><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n6"><a class="md-toc-inner" href="#cc-基础">c/c++ 基础</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n263"><a class="md-toc-inner" href="#操作系统">操作系统</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n264"><a class="md-toc-inner" href="#内存管理">内存管理</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n308"><a class="md-toc-inner" href="#进程">进程</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n377"><a class="md-toc-inner" href="#线程">线程</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n422"><a class="md-toc-inner" href="#文件系统">文件系统</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n461"><a class="md-toc-inner" href="#中断">中断</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n465"><a class="md-toc-inner" href="#组件">组件</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n477"><a class="md-toc-inner" href="#数据库">数据库</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n528"><a class="md-toc-inner" href="#计算机网络">计算机网络</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n653"><a class="md-toc-inner" href="#数据结构与算法">数据结构与算法</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n724"><a class="md-toc-inner" href="#设计模式">设计模式</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n731"><a class="md-toc-inner" href="#编译原理">编译原理</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n742"><a class="md-toc-inner" href="#linux">Linux</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n755"><a class="md-toc-inner" href="#嵌入式">嵌入式</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n762"><a class="md-toc-inner" href="#其他">其他</a></span></p></div><hr /><h1 id='cc-基础'><span>c/c++ 基础</span></h1><ol start='' ><li><p><strong><span>map的实现？与哈希表区别？</span></strong></p></li><li><p><strong><span>vector实现？</span></strong></p></li><li><p><strong><span>C++面向对象的三种特性？</span></strong></p></li><li><p><strong><span>C++继承和组合？你在实际项目中是怎么使用的？什么情况下使用继承？什么情况下使用组合？</span></strong></p></li><li><p><strong><span>C++构造函数可以是虚函数吗？为什么？</span></strong></p></li><li><p><strong><span>C++析构函数可以是虚函数吗？为什么要将析构函数设置为虚函数？</span></strong></p></li><li><p><strong><span>C++如何实现多态？虚表指针是什么时候被初始化的？实例化一个对象需要那几个阶段？</span></strong></p></li><li><p><strong><span>C++偏特化？</span></strong></p></li><li><p><strong><span>重载、重写、覆盖？</span></strong></p></li><li><p><strong><span>static关键字的作用？（要全面）怎么实现的？</span></strong></p><ul><li><span>在函数体外（全局作用域），限制函数或者对象的使用范围为本文件；</span></li><li><span>在函数体内的静态变量，声明周期为整程序运行周期；</span></li><li><span>类的静态方法与静态成员</span></li></ul><p><a href='https://www.cnblogs.com/XuChengNotes/p/10403523.html'><span>https://www.cnblogs.com/XuChengNotes/p/10403523.html</span></a></p></li><li><p><strong><span>inline和宏定义的区别？inline是如何实现的？宏定义是如何实现的？</span></strong></p><p><a href='https://www.cnblogs.com/yanwei-wang/p/8073111.html'><span>C++ inline和#define宏的区别</span></a></p></li><li><p><strong><span>指针和引用的区别？怎么实现的？</span></strong></p><p><a href='https://www.zhihu.com/question/37608201'><span>https://www.zhihu.com/question/37608201</span></a></p></li><li><p><strong><span>字节对齐？结构体大小计算？然后又扯到位域？</span></strong></p><ul><li><span>结构体第一个成员的地址和结构体的首地址相同</span></li><li><span>结构体每个成员地址相对于结构体首地址的偏移量（offset）是该成员大小的整数倍，如果不是则编译器会在成员之间添加填充字节（internal adding）。</span></li><li><span>结构体总的大小要是其成员中最大size的整数倍，如果不是编译器会在其末尾添加填充字节。</span></li></ul><p><a href='https://blog.csdn.net/weixin_42423872/article/details/81229249'><span>https://blog.csdn.net/weixin_42423872/article/details/81229249</span></a></p></li><li><p><strong><span>allocator了解吗</span></strong></p><p><span> </span><a href='https://www.cnblogs.com/SimonKly/p/7819122.html'><span>C++ allocator类学习理解</span></a><span>、</span><a href='https://blog.csdn.net/u012333003/article/details/22104939'><span>C++中的allocator类（内存分配器）</span></a><span>、</span><a href='https://www.zhihu.com/question/274802525'><span>C++中为什么要有allocator类？</span></a><span>、</span><a href='http://www.mamicode.com/info-detail-2341387.html'><span>C++ allocator 自定义指南</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/34725232'><span>《STL源码剖析》提炼总结：空间配置器(allocator)</span></a></p></li><li><p><strong><span>map和unordered_map的底层实现？目前map支持map[10] = 20这种操作，其底层怎么实现的？和insert有什么区别？</span></strong></p></li><li><p><strong><span>map如何遍历删除所有元素？迭代器失效？</span></strong></p></li><li><p><strong><span>一个unique_ptr怎么赋值给另一个unique_ptr对象？（std::move）</span></strong></p></li><li><p><strong><span>下面代码有什么问题？引用计数如何变化？</span></strong></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="c++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-variable-3">*</span><span class="cm-variable">sp</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable-3">int</span>{<span class="cm-number">10</span>};</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">shared_ptr</span><span class="cm-operator">&lt;</span><span class="cm-variable-3">int</span><span class="cm-operator">&gt;</span> <span class="cm-def">sp1</span>(<span class="cm-variable">sp</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">shared_ptr</span><span class="cm-operator">&lt;</span><span class="cm-variable-3">int</span><span class="cm-operator">&gt;</span> <span class="cm-def">sp2</span>(<span class="cm-variable">sp</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 69px;"></div><div class="CodeMirror-gutters" style="display: none; height: 69px;"></div></div></div></pre><p><span>一个地址被连个智能指针所引用，引用计数都是分别计数，所以在释放的时候会释放两次。</span></p></li><li><p><strong><span>c语言的函数调用栈底层详细说说？</span></strong><span>  </span></p><p><span> </span><a href='https://www.cnblogs.com/clover-toeic/p/3755401.html'><span>C语言函数调用栈(一)</span></a><span>、</span><a href='https://www.cnblogs.com/clover-toeic/p/3756668.html'><span>C语言函数调用栈(二)</span></a><span>、</span><a href='https://blog.csdn.net/qq_31567335/article/details/84782202'><span>c语言函数调用过程中栈的工作原理理解</span></a><span>、</span><a href='https://blog.csdn.net/maochengtao/article/details/61630370'><span>C语言函数调用的底层机制</span></a></p></li><li><p><strong><span>static变量存放在哪里？什么时候分配的内存？(这里感觉面试官优点不太清楚，我就详细说了说)</span></strong></p></li><li><p><span>写道题吧：非递归求二叉树的高度？（需要写测试用例）</span></p></li><li><p><strong><span>多态、vector，hashtable，set/map的实现</span></strong><span>、</span><strong><span>智能指针</span></strong><span>、</span><strong><span>C++11</span></strong><span>；</span></p></li><li><p><strong><span>short类型占几个字节，int 类型占几个字节，short和int相加时会有隐式类型转换，对于补码来说，这个转换是在short的高字节位填充什么？把一个负数转换为补码形式最简单的方法应该是怎么做？</span></strong></p></li><li><p><strong><span>带参数的宏定义怎么写？</span></strong></p></li><li><p><strong><span>strlen这个函数如果要自己写应该怎么实现？写了几行简单代码（但我总觉得太简单了，自己的考虑可能不够周全，又短时间内不知道落下了什么。。。）</span></strong></p><p><a href='https://blog.csdn.net/ttyue_123/article/details/52166435'><span>strlen函数的三种实现方式</span></a></p></li><li><p><strong><span>局部变量和全局变量的作用范围和生存周期，外部变量要在另一个源文件中使用要怎么做？加static之后会怎么样？</span></strong></p></li><li><p><strong><span>new的对象可以free吗？为什么？</span></strong></p><p><span>不可以。</span></p></li><li><p><strong><span>为什么析构函数要虚函数</span></strong></p></li><li><p><strong><span>map底层，和avl比有什么优势，</span></strong></p><p><span>map底层使用的是红黑树实现，红黑树牺牲了avl的完全平衡性减少了维持平衡和需要的旋转次数，使得在插入和删除市最多只旋转3次（插入两次）。使得红黑树在插入和删除时更快。并且查找时间也是非常快的。</span></p></li><li><p><strong><span>c++如何实现多态？多态是什么？重写是什么？</span></strong></p></li><li><p><strong><span>C++ 的vector的底层数据结构是什么？为什么2倍扩容？</span></strong></p></li><li><p><strong><span>对于模板了解什么，了解模板底层原理，你对模板的理解是什么？</span></strong></p></li><li><p><strong><span>虚函数什么时候用？</span></strong></p></li><li><p><strong><span>c++析构函数，尽可能把你理解的析构函数介绍一下？</span></strong>
<span>析构函数是为了对对象的一些资源进行释放，析构函数在一些具体的代码中要设置成为虚析构函数，先析构子类</span></p></li><li><p><strong><span>c++的基本数据类型的长度？</span></strong></p></li><li><p><strong><span>对面向对象有什么理解？虚继承？接口继承和实现继承有什么区别？虚基类？</span></strong></p></li><li><p><span>无锁编程 atomic，</span><strong><span>STL 空间配置器源码，shared_ptr源码</span></strong></p></li><li><p><strong><span>C++ 中的map是什么？</span></strong><span>与python中的map有什么不同？</span></p></li><li><p><strong><span>拷贝构造函数：深拷贝和浅拷贝</span></strong></p></li><li><p><strong><span>new函数失败怎么办，</span></strong></p><p><span>我答，抛出bad_alloc异常，可以通过try catch捕捉。或者通过set_new_handler函数设置函数指针处理失败后的异常。</span><br/><span>再问：可以不抛出异常吗？</span><br/><span>答：可以，new时，添加std::nothrow</span><br/><span>三问，set_new_handler函数怎么实现的？</span><br/><span>具体函数实现我没看，不过我猜应该是通过设置signal或者sigaction捕捉信号函数，捕捉到异常的信号后，再用回调函数处理的。</span></p></li><li><p><strong><span>C++11的lambda是如何实现的，它跟真正的仿函数在实现上有什么区别，lambda内部可以有一个局部变量但是仿函数没有，是为什么</span></strong></p><p><a href='https://blog.csdn.net/quinta_2018_01_09/article/details/93763832'><span>lambda表达式与仿函数</span></a><span>、</span><a href='https://blog.csdn.net/K346K346/article/details/82818801'><span>C++ 仿函数</span></a></p></li><li><p><strong><span>dynamic_cast，解决什么问题，引用的情况下不成功返回什么（我说不会，然后让我设计一下，我说抛异常）</span></strong></p></li><li><p><strong><span>C语言中printf中无限参数的问题，怎样实现？</span></strong></p><p><a href='https://blog.csdn.net/yzy1103203312/article/details/80808741'><span>C语言中的可变参数（printf的实现原理）</span></a><span>、</span><a href='https://blog.csdn.net/gengyiping18/article/details/50603326'><span>C语言实现printf函数，即参数可变函数原理</span></a></p></li><li><p><strong><span>对封装的理解，抽象基类</span></strong></p></li><li><p><strong><span>++i， i++是否是原子操作</span></strong><span> </span></p><p><a href='https://blog.csdn.net/u010214092/article/details/50634430'><span>i++和++i是否为原子操作</span></a><span>、</span><a href='https://www.cnblogs.com/lxd2502/p/4648020.html'><span>i++是否原子操作</span></a></p></li><li><p><strong><span>template 怎么理解“泛型”</span></strong></p></li><li><p><strong><span>虚函数类的对象去memoryset内存清零，有什么问题；虚表在哪里存储</span></strong></p></li><li><p><strong><span>析构函数可不可以是私有的；什么情况下会把它私有；</span></strong></p></li><li><p><strong><span>请用C写出实现atoi的程序，要求效率</span></strong></p><p><span>见LeetCode:</span><a href='https://leetcode-cn.com/problems/string-to-integer-atoi/'><span>8. 字符串转换整数 (atoi)</span></a></p></li><li><p><strong><span>闭包</span></strong></p><p><a href='https://www.cnblogs.com/lsgxeva/p/7788259.html'><span>c++11 闭包的实现</span></a><span>、</span><a href='https://www.cnblogs.com/lsgxeva/p/7788555.html'><span>c++11 lambda表达式</span></a></p></li><li><p><strong><span>std::function可以封装哪些实体，可以封装函数对象吗？</span></strong></p><p><span> </span><a href='https://www.cnblogs.com/lsgxeva/p/7788259.html'><span>c++11 闭包的实现</span></a></p></li><li><p><strong><span>lambda表达式介绍一下，可以引用外部变量吗？</span></strong></p><p><a href='https://blog.csdn.net/weixin_39640298/article/details/84996642'><span>C++ lambda表达式及其原理</span></a><span>、</span><a href='https://blog.csdn.net/Sum7mer/article/details/89636651'><span>C++lambda表达式</span></a></p></li><li><p><strong><span>std::bind和lambda表达式区别？</span></strong></p><p><a href='https://www.cnblogs.com/lsgxeva/p/7788259.html'><span>c++11 闭包的实现</span></a><span>、</span><a href='https://www.cnblogs.com/lsgxeva/p/7788555.html'><span>c++11 lambda表达式</span></a></p></li><li><p><strong><span>为什么需要this指针</span></strong></p></li><li><p><strong><span>自增运算符的步骤（内存，寄存器），有两个线程分别自增100次，问最后结果的最大最小值？</span></strong></p><p><a href='https://blog.csdn.net/will130/article/details/48714343?locationNum=5'><span>面试---i++在两个线程分别执行100次，最大值和最小值分别多少</span></a></p></li><li><p><span>实现memcpy函数。</span></p></li><li><p><strong><span>c++使用c函数一样吗，c++编译和c编译有什么不同</span></strong></p><p><a href='https://www.cnblogs.com/qinfengxiaoyue/archive/2013/02/04/2891908.html'><span>C/C++：函数的编译方式与调用约定以及extern “C”的使用</span></a><span>、</span><a href='https://www.jianshu.com/p/fb4cf4d07a18'><span>C/C++ 编译与函数的深度理解</span></a></p></li><li><p><span>gdb多线程调试</span></p></li><li><p><strong><span>公有继承、保护继承和私有继承。</span></strong></p></li><li><p><strong><span>switch的case里为何不能定义变量</span></strong></p><p><span> </span><a href='https://www.cnblogs.com/Younger-Zhang/p/11316290.html'><span>switch-case内不能定义变量？</span></a><span>、</span><a href='https://blog.csdn.net/qq_35865125/article/details/104739997'><span>switch - case 中不能定义变量 的解决办法</span></a><span>、</span><a href='https://www.zhihu.com/question/23051685'><span>请教switch内部的变量定义问题？</span></a></p></li><li><p><strong><span>如果可以确定一个类没有子类，这个类的析构函数还有必要是虚函数吗</span></strong></p><p><span>没有必要，因为一旦设置成虚函数，则对象中一定会有虚函数表占用额外的存储空间，况且虚函数的调用需要从虚函数表里面查询，会额外没必要的增加调用虚函数的成本。</span></p></li><li><p><strong><span>迭代器说一下，迭代器失效了解吗？什么情况下会出现迭代器失效？</span></strong></p></li><li><p><strong><span>STL算法的</span><code>remove</code><span>方法和</span><code>erase</code><span>方法的区别</span></strong></p><p><code>vector</code><span>中的</span><code>remove</code><span>的作用是将等于</span><code>value</code><span>的元素放到</span><code>vector</code><span>的尾部，但并不减少</span><code>vector</code><span>的</span><code>size</code></p><p><code>vector</code><span>中</span><code>erase</code><span>的作用是删除掉某个位置</span><code>position</code><span>或一段区域（begin, end)中的元素，减少其size</span></p><p><code>list</code><span>容器中的</span><code>remove</code><span> 成员函数，原型是v</span><code>oid remove (const value_type&amp; val);</code><span>作用是删除</span><code>list</code><span>中值与</span><code>val</code><span>相同的节点，释放该节点的资源。而</span><code>list</code><span>容器中的</span><code>erase</code><span>成员函数，原型是</span><code>iterator erase (iterator position);</code><span>作用是删除</span><code>position</code><span>位置的节点。考虑到</span><code>list::erase</code><span>是与位置有关，故</span><code>erase</code><span>还存在API:  </span><code>iterator erase (iterator first, iterator last);</code></p><p><span>对于</span><code>set</code><span>来说，只有</span><code>erase</code><span> API，没有</span><code>remove</code><span> API。 </span><code>erase</code><span> 的作用是把符合要求的元素都删掉。</span></p><ul><li><code>void erase (iterator position);</code></li><li><code>size_type erase (const value_type&amp; val);</code></li><li><code>void erase (iterator first, iterator last);</code></li></ul><p><span>综上所述，</span><code>erase</code><span>一般是要释放资源，真正删除元素的，而</span><code>remove</code><span>主要用在</span><code>vector</code><span>中，用于将不符合要求的元素移到容器尾部，而并不删除不符合要求的元素。</span></p><p><span>以上引用</span><a href='https://www.cnblogs.com/buptlyn/p/4379212.html'><span>STL：remove和erase区别</span></a></p></li><li><p><strong><span>SFINAE 技术</span></strong></p><p><a href='https://zhuanlan.zhihu.com/p/21314708'><span>C++模板进阶指南：SFINAE</span></a></p></li><li><p><strong><span>元编程，type_trait的理解</span></strong></p></li><li><p><strong><span>迭代器的作用</span></strong></p></li><li><p><strong><span>C语言中变长参数的实现原理</span></strong></p></li><li><p><strong><code>std::forward</code><span>的作用</span></strong></p><p><span>完美转发，利用应用的折叠原则：</span><code>T&amp; &amp;&amp; -&gt; T&amp;, T&amp;&amp; &amp;&amp; -&gt; T&amp;&amp;</code><span>来完成完美转发。</span></p></li><li><p><strong><span>为什么系统调用比普通函数调用消耗大？</span></strong></p><p><span>切换用户栈，内核栈，保存寄存器信息，这些只是基本开销。还有页表切换，不同用户的页表是不一样的，系统调用为了服务不同用户，需要切换页表。切换页表意味着cpu缓存失效。而且内核空间跟用户空间地址空间相差很大，指令预测系统也会失效。系统调用需要在用户空间和内核空间进行切换，普通函数调用只是同一个空间调用，只是压栈这一点开销，相对于系统调用这点开销并不算什么，甚至函数式编程的压栈开销都没有。</span></p><p><a href='https://www.zhihu.com/question/400440365'><span>https://www.zhihu.com/question/400440365</span></a></p></li><li><p><strong><span>可以直接交换两个同类型对象的内存数据吗？</span></strong></p><p><span>c/c++中没有类似的命令与操作不过可以自己重载与函数等等从语义上实现交换</span></p></li><li><p><strong><span>c++ 11中union的变量可以为非POD类型吗？</span></strong></p><p><span>c++11之前是不允许的，但是在c++11之后消除了这个限制，但是如果是union包含非POD类型，则需要自定义默认构造函数。</span></p><p><span> </span><a href='https://blog.csdn.net/wangeen/article/details/8439306'><span>C++ union(只支持基础类型)</span></a><span>、</span><a href='https://blog.csdn.net/ml422524/article/details/77941546'><span>c++11中，含有类类型的union</span></a><span>、</span><strong><a href='https://kb.kutu66.com/others/post_12551674'><span>c++ - 关于 C++ 非POD联合的c++11问题</span></a></strong><span>、</span><a href='https://www.cnblogs.com/time-is-life/p/9629111.html'><span>c++中POD类型和non-POD类型</span></a><span>、</span><a href='http://c.biancheng.net/view/7165.html'><span>C++11非受限联合体（union）</span></a></p></li><li><p><strong><span>C++垃圾回收机制</span></strong></p><p><a href='https://blog.csdn.net/u012611878/article/details/78947267'><span>C++中垃圾回收机制中几种经典的垃圾回收算法</span></a><span>、</span><a href='https://www.cnblogs.com/blfshiye/p/3764059.html'><span>C++垃圾回收机制</span></a><span>、</span><a href='https://blog.csdn.net/yeahhook/article/details/6796242'><span>C++为什么不加入垃圾回收机制</span></a><span>、</span><a href='https://www.cnblogs.com/lidabo/p/3487045.html'><span>C/C++中几种经典的垃圾回收算法</span></a><span>、</span><a href='https://www.zhihu.com/question/308638046'><span>什么情况下 C++ 需要垃圾处理机制？</span></a></p></li><li><p><span>浮点数怎么表示？大概说了下ieee754,浮点数表示范围连续吗？为什么不连续？</span></p><p><a href='http://www.cppblog.com/jianjianxiaole/articles/float.html'><span>浮点数的表示范围</span></a></p></li><li><p><code>volatile</code></p><p><a href='https://www.cnblogs.com/god-of-death/p/7852394.html'><span>C/C++ Volatile关键词深度剖析</span></a><span>、</span><a href='https://blog.csdn.net/weixin_41656968/article/details/80958973'><span>C++中volatile的作用</span></a></p></li><li><p><strong><span>那如何实现对一个常量进行引用</span></strong></p></li><li><p><strong><span>vector底层原理，resize和reserve方法原理</span></strong></p></li><li><p><strong><span>C++中异常处理中try-catch的实现机制,问假设一个try后有多个catch，catch的异常类型相同，是怎么匹配到对应的catch的。</span></strong></p><p><a href='http://c.biancheng.net/view/422.html'><span>C++异常处理（try catch throw）完全攻略</span></a><span>、</span><a href='http://www.baiy.cn/doc/cpp/inside_exception.htm'><span>C++异常机制的实现方式和开销分析</span></a><span>、</span><a href='http://www.baiy.cn/doc/cpp/index.htm#%E4%BB%A3%E7%A0%81%E9%A3%8E%E6%A0%BC%E4%B8%8E%E7%89%88%E5%BC%8F_%E5%BC%82%E5%B8%B8'><span>异常</span></a><span>、</span><a href='https://blog.csdn.net/caihaitao2000/article/details/79827857'><span>C++异常处理机制</span></a></p></li><li><p><strong><span>C++中组合、继承的机制了解吗？</span></strong></p></li><li><p><strong><span>虚函数指针存放在内存中什么位置</span></strong></p></li><li><p><strong><span>调用</span><code>malloc</code><span>的时候要求 8 bytes 内存对齐，怎么处理？</span></strong></p><p><a href='https://blog.csdn.net/sweetfather/article/details/79798962'><span>malloc(malloc在32位编译系统中分配的地址会8字节对齐，64为编译系统中会8或者16字节对齐)</span></a><span>、</span><a href='https://blog.csdn.net/shemangui/article/details/50459102?locationNum=1'><span>malloc内存分配字节对齐问题</span></a><span>、</span><a href='https://www.cnblogs.com/sigma0/p/10837760.html'><span>malloc分配内存进行对齐的操作</span></a><span>、</span><a href='https://www.douban.com/note/643194488/'><span>用malloc分配内存的字节对齐，指针对齐</span></a><span>、</span><a href='http://cn.voidcc.com/question/p-cdlgkjum-sm.html'><span>malloc会保证内存对齐吗？</span></a></p></li><li><p><strong><span>介绍C++内存配置器</span></strong></p><p><a href='https://www.cnblogs.com/xietianjiao/p/12344339.html'><span>c++ STL（六 空间配置器、内存配置器）</span></a><span>、</span><a href='https://www.cnblogs.com/xietianjiao/p/12344098.html'><span>c++ stl 内存配置器</span></a><span>、</span><a href='https://www.cppentry.com/bencandy.php?fid=49&amp;id=149890'><strong><span>STL库的内存配置器（allocator）</span></strong></a></p></li><li><p><span>实现</span><code>lower_bound</code></p></li><li><p><span>考虑如下代码</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="c++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">class</span> <span class="cm-def">A</span> {</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">virtual</span> <span class="cm-variable-3">void</span> <span class="cm-variable">foo</span>() <span class="cm-operator">=</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">};</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">class</span> <span class="cm-def">B</span> : <span class="cm-keyword">public</span> &nbsp;<span class="cm-variable">A</span>{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">};</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 115px;"></div><div class="CodeMirror-gutters" style="display: none; height: 115px;"></div></div></div></pre><ul><li><code>sizeof(A)</code><span>在 32 位的机器上会出现什么问题？</span>
<code>sizeof(A)=4</code></li><li><span>使用</span><code>class B</code><span>的话，后续可能会出现什么问题？（析构函数不是虚函数）</span></li><li><span>编译器为</span><code>class B</code><span>生成了哪些函数？有右值版本的函数吗？</span></li></ul></li><li><p><strong><span>下面例子中，</span><code>std::move</code><span>失效的情况，即没有调用右值版本的</span><code>push_back()</code><span>。（A是内置类型或者A没有右值版本的拷贝构造函数）</span></strong></p><p><span>在c++11之后已经有了右值版本的</span><code>push_back()</code></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="c++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">vector</span><span class="cm-operator">&lt;</span><span class="cm-variable">A</span><span class="cm-operator">&gt;</span> <span class="cm-variable">a</span>;</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">a</span>.<span class="cm-variable">push_back</span>(<span class="cm-variable">A</span>());</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 46px;"></div><div class="CodeMirror-gutters" style="display: none; height: 46px;"></div></div></div></pre></li><li><p><strong><span>怎么让一个类获取到自己的</span><code>shared_ptr</code><span>？主要考察</span><code>enable_shared_from_this</code><span>。</span></strong></p><p><span>在</span><code>class</code><span>内部,获得</span><code>this</code><span>指针的</span><code>shared_ptr</code><span>,需要</span><code>class</code><span>继承</span><code>std::enable_shared_from_this</code></p><p><span>、</span><a href='https://www.zhihu.com/question/30957800'><span>std::enable_shared_from_this 有什么意义？</span></a><span>、</span><a href='https://blog.csdn.net/QIANGWEIYUAN/article/details/88973735'><span>C++智能指针的enable_shared_from_this和shared_from_this机制</span></a><span>、</span><a href='https://blog.csdn.net/caoshangpa/article/details/79392878'><span>C++11新特性之十：enable_shared_from_this</span></a><span>、</span></p></li><li><p><strong><span>sizeof一个空类的大小，为什么是1，以及衍生的一些判断类大小以及为什么；</span></strong></p><p><a href='https://blog.csdn.net/cy_cai/article/details/52979402'><span>空类的sizeof为1，为什么？</span></a></p></li><li><p><strong><span>虚函数表指针通常存储在类对象的哪个位置?为什么</span></strong></p></li><li><p><strong><code>std::move</code><span>失效</span></strong></p><p><a href='https://www.cyhone.com/articles/why-move-no-work-in-lambda/'><span>C++ lambda 内 std::move 失效问题的思考</span></a><span>如果</span><code>std::move</code><span>的参数是一个常量引用，则会造成失效。</span></p></li></ol><hr /><h1 id='操作系统'><span>操作系统</span></h1><h2 id='内存管理'><span>内存管理</span></h2><ol start='' ><li><p><span>malloc和mmap的底层实现？malloc分配的是什么？</span></p></li><li><p><span>Linux进程地址空间布局？（这里又问道虚拟内存和分页、页表这些东西）</span></p></li><li><p><span>页表是什么</span></p></li><li><p><span>堆上的对象和栈上的对象有什么分别？</span></p></li><li><p><span>内存分配算法了解吗，比如说给你一个内存池，碎片和效率，策略</span></p></li><li><p><span>内存泄漏怎么规避呢？</span></p></li><li><p><span>操作系统的内存分配</span></p></li><li><p><span>C++ 内存泄漏和内存越界有什么区别？内存泄漏怎么预防</span></p></li><li><p><span>栈空间分配</span></p></li><li><p><span>内存中堆和栈那一种结构快?为什么栈更快?</span></p><p><span>栈快,系统控制释放，内存连续，无碎片</span></p></li><li><p><span>堆区栈区的区别？--》C++的内存分布</span></p></li><li><p><span>用户态与内核态的区别？（为什么要有内核态）</span></p></li><li><p><span>Mmap在用户区还是内核区？为什么快速？</span></p></li><li><p><span>检测内存泄漏</span></p></li><li><p><span>动态内存申请方式？会不会失败？失败会怎么样？</span></p></li><li><p><span>栈里面放的一般都有什么，栈和堆了解吗？</span></p></li><li><p><span>访问NULL指针为什么会报错？编译期报错还是运行期报错？编译器会编译这个指令，所以应该是运行期报错，0号地址也是地址，如何实现这个访问0号地址报错这个机制？内存是如何寻址的？</span>
<span>这里一开始只想到了寻址方式，没推测出答案，后来查发现他想说的其实应该是地址转换，这里我后来查到好像是0号地址在地址转换的过程中会把0号地址映射到一个用户没有权限访问的一个页中，然后每次在这个时候报错。</span></p></li><li><p><span>如果malloc 1G的内存，将其512M位置的地方赋值为1，此时实际分配的物理内存会是512M吗？</span></p></li><li><p><span>C++内存分配堆栈在内存中的大小,使用malloc函数，在32位机器上1G的物理内存能获取到的内存大小。</span></p></li><li><p><span>用户态到内核态的切换，两者怎么进行通信</span></p><p><a href='https://blog.csdn.net/u012333003/article/details/29384807'><span>用户态与内核态之间的切换</span></a><span>、</span><a href='https://www.cnblogs.com/viviwind/archive/2012/09/22/2698450.html'><span>内核态和用户态的区别 zz</span></a><span>、</span><a href='https://cloud.tencent.com/developer/article/1454965'><span>Linux用户态与内核态通信的几种方式</span></a><span>、</span><a href='https://www.cnblogs.com/bakari/p/5520860.html'><span>Linux探秘之用户态与内核态</span></a><span>、</span><a href='https://blog.nowcoder.net/n/5541fdad534649c2933937a7af0be1ec'><span>用户态/内核态/线程/协程</span></a></p></li></ol><h2 id='进程'><span>进程</span></h2><ol start='' ><li><p><strong><span>进程调度的方式有哪些？Linux中进程调度的方式？</span></strong></p><p><a href='https://blog.csdn.net/qq_38410730/article/details/81253686'><span>【Linux】Linux的进程调度</span></a><span>、</span><a href='https://blog.csdn.net/qq_39487033/article/details/83097374'><span>【Linux】几种常见的进程调度</span></a><span>、</span><a href='https://www.cnblogs.com/zhaoyl/archive/2012/09/04/2671156.html'><span>Linux进程调度原理</span></a><span>、</span><a href='https://blog.csdn.net/qq_35642036/article/details/82809812'><span>操作系统中的进程调度策略有哪几种</span></a><span>、</span><a href='https://www.cnblogs.com/alantu2018/p/8460451.html'><span>Linux常见的进程调度算法</span></a></p></li><li><p><strong><span>单进程与IO复用？</span></strong></p><p><a href='https://blog.csdn.net/wan_hust/article/details/38441455'><span>IO复用、多进程和多线程三种并发编程模型</span></a><span>、</span><a href='https://blog.csdn.net/xd_rbt_/article/details/80287959'><span>I/O复用的理解</span></a><span>、</span><a href='https://www.cnblogs.com/lifei01/p/10733532.html'><span>IO模式和IO多路复用详解</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/115220699'><span>一文看懂IO多路复用</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/148972109'><span>Linux IO模式及 select、poll、epoll详解（含部分实例源码）</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/141447239'><span>Linux I/O复用中select poll epoll模型的介绍及其优缺点的比较</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/63179839'><span>如果这篇文章说不清epoll的本质，那就过来掐死我吧！</span></a></p></li><li><p><strong><span>下面代码打印输出？（写出四组）</span></strong></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="c++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;sys/types.h&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;unistd.h&gt;</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">pid_t</span> <span class="cm-variable">pid1</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">pid_t</span> <span class="cm-variable">pid2</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">pid1</span> <span class="cm-operator">=</span> <span class="cm-variable">fork</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">pid2</span> <span class="cm-operator">=</span> <span class="cm-variable">fork</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">cout</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-string">"cur pid:"</span><span class="cm-operator">&lt;&lt;</span><span class="cm-variable">getpid</span>() <span class="cm-operator">&lt;&lt;</span> <span class="cm-string">",pid1:"</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-variable">pid1</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-string">",pid2:"</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-variable">pid2</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-variable">endl</span>;</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 230px;"></div><div class="CodeMirror-gutters" style="display: none; height: 230px;"></div></div></div></pre><p>&nbsp;</p></li><li><p><strong><span>僵尸进程和孤儿进程？</span></strong></p><p><a href='https://blog.csdn.net/sofia_fhx/article/details/88758007'><span>操作系统-进程状态转换图</span></a><span>、</span><a href='https://www.cnblogs.com/lrhya/p/10636011.html'><span>进程的状态转换</span></a><span>、</span><a href='https://blog.csdn.net/weixin_41050155/article/details/81945208'><span>僵尸进程与孤儿进程详解</span></a><span>、</span><a href='https://blog.csdn.net/a13568hki/article/details/103851388'><span>孤儿进程和僵尸进程的区别</span></a></p></li><li><p><strong><span>一个进程能不能绑定到一个cpu？系统调用接口是什么？线程呢？</span></strong></p><p><a href='https://blog.csdn.net/sangyongjia/article/details/50725734'><span>如何将一个进程（线程）绑定到一个固定的CPU核上？</span></a><span>、</span><a href='https://www.cnblogs.com/swey/p/4469722.html'><span>Linux进程或线程绑定到CPU</span></a><span>、</span><a href='https://www.ibm.com/developerworks/cn/linux/l-affinity.html'><span>管理处理器的亲和性（affinity）</span></a><span>、</span><a href='https://www.zhihu.com/question/31683094?sort=created'><span>一个进程能不能在多个核上跑？</span></a></p></li><li><p><strong><span>fork、死锁</span></strong></p><p><a href='https://baike.baidu.com/item/fork/7143171?fr=aladdin'><span>百度百科fork</span></a><span>、</span><a href='https://www.cnblogs.com/love-jelly-pig/p/8471206.html'><span>fork()函数详解</span></a><span>、</span><a href='https://www.cnblogs.com/tp-16b/p/9005079.html'><span>浅析fork()和底层实现</span></a></p></li><li><p><strong><span>对进程调度的理解，用来解决什么问题？进程调度的策略有哪些（调度算法）？我们用的电脑用的什么算法（时间片轮转法）？</span></strong></p><p><span>在计算机系统中，可能同时有数百个批处理作业存放在磁盘的作业队列中，或者有数百个终端与主机相连接，这样一来内存和处理器等资源便供不应求。如何从这些作业中挑选作业进入主存运行、如何在进程之间分配处理器时间，无疑是操作系统资源管理中的一个重要问题。因此引入处理器调度用来完成涉及处理器分配的工作，而其中的低级调度，执行分配CPU 的程序即分派程序(dispatcher)，它是操作系统最为核心的部分，执行十分频繁，低级调度策略优劣直接影响到整个系统的性能。引入的目的是按照某种原则决定就绪队列中的哪个进程或内核级线程能获得处理器，并将处理器出让给它进行工作。</span></p><p><span>以上引用</span><a href='https://zhidao.baidu.com/question/344015549.html'><span>为什么要引入进程调度,引入进程调度的目的是什么?</span></a></p><p><span>参考</span><a href='https://www.douban.com/note/709879948/'><span>如何理解进程调度?</span></a><span>、</span><a href='https://www.jianshu.com/p/6e1fa5cf62cb'><span>进程调度总结</span></a><span>、</span><a href='http://c.biancheng.net/cpp/html/2594.html'><span>处理机调度：调度的概念、时机、切换、过程以及调度方式和基本准则</span></a></p></li><li><p><strong><span>进程通信的机制有哪些？（IPC）</span></strong></p><p><span>信号，管道（命名管道FIFO，无名管道PIPE）、共享内存、信号量、消息队列、</span></p></li><li><p><span>可重入函数：只了解strork</span></p></li><li><p><strong><span>父进程子进程共享什么？</span></strong></p><p><a href='https://blog.csdn.net/zhuoyue01/article/details/105976937/'><span>父子进程共享内容</span></a></p></li><li><p><strong><span>子进程的生命周期受什么影响？</span></strong></p><p><span>  </span><a href='https://blog.csdn.net/q1n2hen/article/details/77996396'><span>进程生命周期</span></a><span>、</span><a href='https://blog.csdn.net/xiaojunling/article/details/81476257'><span>进程的生命周期</span></a></p></li><li><p><strong><span>进程有几种状态？执行到就绪的转换情况？执行到阻塞的转换情况？</span></strong></p></li><li><p><span>点击鼠标，内存发 生了什么？</span></p></li><li><p><strong><span>用锁的时候发生竞争会把进程陷入到内核态还是保留在用户态，为什么</span></strong></p><p><span>  </span><a href='https://blog.csdn.net/lengye7/article/details/88392407'><span>用户态切换到内核态主要有三种方式</span></a><span>、</span><a href='https://blog.csdn.net/gd359353793/article/details/86715099'><span>对内核,内核线程,用户线程,用户态,内核态,进程等理解</span></a></p></li><li><p><strong><span>饿汉模式；懒汉模式；线程安全的写法；</span></strong></p><p><span>  </span><a href='https://www.cnblogs.com/da-peng/p/8278714.html'><span>单利模式（饿汉模式，懒汉模式）线程安全与解决问题</span></a><span>、</span><a href='https://blog.csdn.net/Shangxingya/article/details/106715371'><span>JavaWeb~用饿汉模式、懒汉模式(高性能线程安全版)分别实现单例模式</span></a></p></li><li><p><strong><span>一个进程可以打开的fd有限，到并发量很大的时候，fd耗尽了，怎么办？</span></strong></p><p><span>  </span><a href='https://blog.csdn.net/yunqiinsight/article/details/86468967'><span>通过FD耗尽实验谈谈使用HttpClient的正确姿势</span></a><span>、</span><a href='https://www.zhihu.com/question/37219281?sort=created'><span>为什么select打开的FD数量有限制，而poll、epoll等打开的FD数量没有限制？</span></a></p></li><li><p><strong><span>惊群模式</span></strong></p><p><span>  </span><a href='https://blog.csdn.net/lyztyycode/article/details/78648798?utm_source=blogxgwz2'><span>Linux惊群效应详解（最详细的了吧）</span></a><span>、</span><a href='https://www.cnblogs.com/Anker/p/7071849.html'><span>Linux网络编程“惊群”问题总结</span></a><span>、</span><a href='https://www.jianshu.com/p/9d0899c9ec89'><span>Linux网络编程“惊群”问题</span></a><span>、</span><a href='https://blog.csdn.net/thlzjfefe/article/details/97495073'><span>什么是惊群，如何有效避免惊群?</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/42882130'><span>解决多进程模式下引起的“惊群”效应</span></a><span>、</span><a href='https://blog.csdn.net/second60/article/details/81252106'><span>[框架]高并发中的惊群效应</span></a></p></li><li><p><strong><span>进程切换上下文细节</span></strong></p><p><span> </span><a href='https://blog.csdn.net/yapian8/article/details/41809837'><span>进程切换（进程上下文和中断上下文）详解</span></a><span>、</span><a href='https://www.cnblogs.com/tjyuanxi/p/9314810.html'><span>进程上下文切换分析</span></a><span>、</span><a href='https://www.jianshu.com/p/ebf1f832694c'><span>进程/线程上下文切换会用掉你多少CPU？</span></a></p></li><li><p><strong><span>不同进程是如何保证使用的内存互不影响</span></strong></p><p><span> 多进程的执行通过内存保护实现互不干扰，如页式管理中有页地址越界保护，段式管理中有段地址越界保护。</span></p></li><li><p><strong><span>进程挂了共享内存是否还存在，为什么？</span></strong><span>（不知道，结束之后百度：进程间通信使用的数据结构:管道、socket、共享内存、消息队列、信号量等，是属于内核级的，一旦创建后就由内核管理，若进程不对其主动释放，那么这些变量会一直存在，除非重启系统。）</span></p><p><span> </span><a href='https://www.cnblogs.com/xcywt/p/5128430.html'><span>Linux进程间通信之共享内存</span></a><span>、</span><a href='https://www.cnblogs.com/tp-16b/p/8987697.html'><span>进程间通信——IPC之共享内存</span></a><span>、</span><a href='http://blog.chinaunix.net/uid-27164517-id-3319185.html'><span>多进程与多线程的优劣 与 共享内存的同步问题</span></a></p></li><li><p><span>父进程如何fork一个子进程的，具体过程,父进程如何fork一个子进程，父进程内部的代码段、数据需要在拷贝一份给子进程吗？如果不拷贝的话，共用的话，内核如何保证他们不会出问题？</span></p><p><span> 不会立即复制，在最开始，是公用代码段和数据段，当需要进行写入的时候才拷贝。</span></p><p><span> </span><a href='https://blog.csdn.net/qq_37924084/article/details/78299352'><span>fork创建进程过程（底层实现） 和 写实拷贝</span></a><span>、</span></p></li><li><p><span>系统调用的最小单元是什么？线程相对于进程，独占了什么？</span></p><p><span>  </span><a href='https://www.cnblogs.com/tiankong101/p/4229584.html'><span>深入理解进程和线程</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/70256971'><span>【面试高频问题】线程、进程、协程</span></a><span>、</span><a href='https://blog.csdn.net/gatieme/article/details/51481863'><span>内核线程、轻量级进程、用户线程三种线程概念解惑（线程≠轻量级进程）</span></a><span>、</span><a href='https://www.jianshu.com/p/84957c2644d8'><span>进程、线程及进程调度算法</span></a><span>、</span></p></li></ol><h2 id='线程'><span>线程</span></h2><ol start='' ><li><p><span>线程池如何开启一个新线程？</span></p></li><li><p><span>线程池</span></p><p><a href='https://zhuanlan.zhihu.com/p/61464921'><span>线程池的C++实现</span></a><span>、</span><a href='https://blog.csdn.net/u012234115/article/details/89856320'><span>C++11实现线程池</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/88896082'><span>【C/C++】 Pthread线程池</span></a><span>、</span><a href='https://www.zhihu.com/question/27908489/answer/355105668'><span>用 C++ 写线程池是怎样一种体验？</span></a></p></li><li><p><span>线程池初始化的步骤？</span></p></li><li><p><span>线程池中线程状态？</span></p></li><li><p><span>主线程与IO线程之间描述符传递？</span></p><p><a href='https://www.cnblogs.com/alan666/p/8311890.html'><span>Linux 文件描述符详解</span></a><span>、</span><a href='http://c.biancheng.net/view/3066.html'><span>Linux文件描述符到底是什么？</span></a><span>、</span><a href='https://zhuanlan.zhihu.com/p/134036259'><span>Linux文件描述符--就这？</span></a><span>、</span><a href='https://www.jianshu.com/p/504a53c30c17'><span>linux中的文件描述符(file descriptor)和文件</span></a></p></li><li><p><code>pthread_detach</code><span>和</span><code>pthread_join</code><span>的作用？</span></p><p><a href='https://blog.csdn.net/sinat_29844779/article/details/72490111'><span>pthread_join和pthread_detach的作用</span></a><span>、</span><a href='https://www.cnblogs.com/fnlingnzb-learner/p/6959285.html'><span>pthread_join和pthread_detach的用法</span></a></p></li><li><p><span>进程线程区别、进程/线程通信</span></p></li><li><p><span>锁相关了解吗？线程安全怎么办？（回答可重入函数，锁）</span></p></li><li><p><span>线程、进程和协程</span></p><p><a href='https://juejin.im/post/5d5df6b35188252ae10bdf42'><span>什么是协程 ？</span></a><span>、</span><a href='https://zh.wikipedia.org/wiki/%E5%8D%8F%E7%A8%8B'><span>协程</span></a><span>、</span><a href='https://www.jianshu.com/p/2782f8c49b2a'><span>coroutine协程详解</span></a><span>、</span><a href='https://www.zhihu.com/question/20511233'><span>协程的好处有哪些？</span></a><span>、</span><a href='https://hanfeng.ink/post/coroutine/'><span>协程简介</span></a></p></li><li><p><span>死锁的产生条件，怎样预防死锁</span></p><p><span> </span><a href='https://www.cnblogs.com/bopo/p/9228834.html'><span>死锁的四个必要条件？如何避免与预防死锁？</span></a></p></li><li><p><span>一个进程里面有很多线程，设计一个机制，可以知道哪些线程在工作，哪些出了问题</span></p></li><li><p><span>为什么用多线程，apache为什么用多进程，nginx为什么用多线程</span></p></li><li><p><span>介绍一下几种锁（互斥、信号量、条件变量、读写锁、自旋锁）</span></p></li><li><p><span>运用多线程有什么要注意的吗？（join回收子线程）还有啥？</span></p></li><li><p><span>子线程正常死亡与其他线程cancel这个子线程（被动死亡）有什么区别？（不知道）</span></p><p><span> </span><a href='https://blog.csdn.net/qingzhuyuxian/article/details/81019173'><span>linux下pthread_cancel无法取消线程的原因</span></a><span>、</span><a href='https://blog.csdn.net/u011878172/article/details/79510824'><span>线程pthread_cancel()函数</span></a><span>、</span><a href='https://www.cnblogs.com/lijunamneg/archive/2013/01/25/2877211.html'><span>线程取消(pthread_cancel)</span></a><span>、</span><a href='https://www.cnblogs.com/mydomain/archive/2011/08/15/2139826.html'><span>5、线程终止方式：pthread_cleanup_push/pthread_cleanup_pop()</span></a></p></li><li><p><span>线程切换上下文细节</span></p></li><li><p><strong><span>线程共享一块内存，进程不共享，线程全都共享吗</span></strong></p><p><span> </span><a href='https://blog.csdn.net/yuanbinquan/article/details/41699491'><span>linux线程共享和进程内存的关系</span></a><span>、</span><a href='https://www.cnblogs.com/baoendemao/p/3804677.html'><span>同一进程中的线程究竟共享哪些资源</span></a></p></li><li><p><span>对比I/O多路复用和多线程</span></p></li></ol><h2 id='文件系统'><span>文件系统</span></h2><ol start='' ><li><p><span>阻塞和非阻塞？同步和异步？</span></p></li><li><p><span>五种IO模型？</span></p><p><a href='https://blog.csdn.net/ZWE7616175/article/details/80591587'><span>五种IO模型（详解+形象例子说明）</span></a><span>、</span><a href='https://www.cnblogs.com/shengguorui/p/11949282.html'><span>IO概念和五种IO模型</span></a><span>、</span><a href='https://www.cnblogs.com/f-ck-need-u/p/7624733.html'><span>五种IO模型透彻分析</span></a></p></li><li><p><span>select和epoll有什么区别？epoll的LT和ET模式？LT和ET适用场景？</span></p><p><a href='https://blog.csdn.net/qq_41038824/article/details/88537640'><span>select、poll、epoll的区别以及epoll的两种模式（LT、ET）以及实现</span></a><span>、</span><a href='https://blog.csdn.net/cws1214/article/details/47662705'><span>epoll两种类型ET和LT区别(结合实际例子)</span></a><span>、</span><a href='https://blog.csdn.net/qingcunsuiyue/article/details/66477777'><span>I/O多路复用之select、epoll的实现和区别 ，ET与LT模式</span></a></p></li><li><p><span>select/poll/epoll、虚拟内存、用户态内核态；</span></p></li><li><p><span>Linux中，文件名存在哪里？</span></p><p><a href='https://blog.csdn.net/wdkirchhoff/article/details/44205143'><span>Linux 中文件名存在哪里？</span></a><span>、</span><a href='https://blog.csdn.net/pugongying_95/article/details/97295843'><span>Linux文件名存在哪儿</span></a></p></li><li><p><span>文件索引有哪些？</span></p></li><li><p><span>select和epoll有没有最大描述符限制，epoll的限制体现在哪？epoll底层用了哪些数据结构，红黑树和链表分别是用来干啥的，红黑树的key是什么？</span></p><p><a href='https://blog.csdn.net/historyasamirror/article/details/5833259'><span>epoll“传说中”的性能</span></a><span>、</span><a href='https://blog.csdn.net/lishitao_578/article/details/73810623'><span>Linux下实现epoll服务器和缺点总结</span></a><span>、</span></p></li><li><p><span>从磁盘读取数据到CPU中间经过的介质</span></p><p><span>硬盘数据---&gt;硬盘缓存----&gt;内存----&gt;CPU缓存---&gt;CPU寄存器与运算器</span></p></li><li><p><span>linux下可执行文件组织机制(内存布局,.text,.bss,.data组织方式等）。</span></p></li><li><p><span>IOCP</span></p></li><li><p><span>linux系统怎么区别文件类型</span></p><p><a href='https://zhidao.baidu.com/question/511065836.html'><span>linux操作系统文件类型有哪几种,有什么区别?</span></a><span>、</span><a href='https://www.cnblogs.com/miaotianjie/p/8587650.html'><span>Linux系统目录结构及文件类型区分</span></a><span>、</span></p></li><li><p><span>五种io模型</span></p><p><span>同步IO：阻塞IO、非阻塞IO、IO多路复用、信号驱动IO；异步IO</span></p></li><li><p><span>什么情况下epoll效率会比select\poll低,epoll底层的实现原理，如何保证大部分情况下效率优于select</span></p></li><li><p><span>操作系统读写操作，写文件，read的三种模式，写成功是怎样的，什么情况下写操作会失败</span></p></li><li><p><a href='https://www.cnblogs.com/ldp-web/archive/2011/10/21/2220180.html'><span>Open/Read/Write和Fopen/Fread/Fwrite的区别</span></a><span>、</span><a href='https://blog.csdn.net/yangbodong22011/article/details/63064166/'><span>多进程同时写一个文件会怎样？（待修订）</span></a></p></li></ol><h2 id='中断'><span>中断</span></h2><ol start='' ><li><span>中断的上半部与下半部的区别，什么是中断时延</span></li></ol><h2 id='组件'><span>组件</span></h2><ol start='' ><li><p><span>如何实现日志系统？</span></p><ul><li><span>日志数据生成过快怎么解决？</span></li></ul></li><li><p><span>定时器实现？</span></p></li><li><p><span>什么是实时操作系统，</span><code>如何实现实时</code><span>，</span><code>与分时操作系统的区别</code><span>。</span><code>如何实现优先级反转</code></p></li></ol><hr /><h1 id='数据库'><span>数据库</span></h1><ol start='' ><li><span>k-v数据库如果get有百分之80的数据都不命中有什么好的处理方法？</span></li><li><span>MySQL</span></li><li><span>sql查询太慢如何优化</span></li><li><span>mysql的存储引擎？两个的区别？myisam哪些环节执行效率会更高？表比较小，或者有大量的select语句</span></li><li><span>部署过mysql吗，主备复制安装过吗？主备复制有哪些方式？有什么区别？</span></li><li><span>nosql了解过吗？关于数据库听说过哪些？</span></li><li><span>mysql的索引结构：</span>
<span>myisam，innodb不同的索引结构</span>
<span>索引的存储结构（数据结构）</span></li><li><span>非主键索引？什么是覆盖索引？事务隔离级别？别介绍一下主要区别和应用场景？</span></li><li><span>数据库里面的死锁介绍一下？（介绍一个具体例子）什么是死锁，什么情况下产生死锁？</span></li><li><span>innodb和myisam区别？为什么查询比较多的时候为什么用myisam？存储结构不同，mysiam索引和数据不在一起</span></li><li><span>redis有没有做持久化，redis宕掉会怎么样，怼我说你只是用redis做了一个没有质量保证的消息队列而已</span></li><li><span>数据库常用优化方法，数据库四大隔离级别</span></li><li><span>SQLite和MySQL的区别</span></li><li><span>redis的高可用，主从、哨兵、集群，主从的选举过程</span></li><li><span>mysql高可用，主从，最新版本？mysql主从同步是异步的吗？有同步的吗？半同步复制</span></li><li><span>关系型数据库是什么</span></li><li><span>b+树说说。为什么数据库用b+树不用红黑树？</span></li><li><span>为什么索引不宜太多？索引太多，文件过大。还有第二点没答出来，更新数据的时候索引也要更新，耗时。</span></li><li><span>数据库cpu跟不上请求频率，应该如何优化？</span></li><li><span>无锁队列之类</span></li><li><span>数据库问了好多，问了好多底层的东西；数据库结构是hash结构还是树形，为什么?数据库有哪些优化？</span></li><li><span>map的底层实现？zset的底层实现？为什么zset不使用红黑树作为其底层实现？为什么map不使用跳表作为其底层实现？</span></li><li><span>MYSQL中实现网页翻页的话怎样写SQL语句？</span></li><li><span>sql注入了解吗？</span></li></ol><hr /><h1 id='计算机网络'><span>计算机网络</span></h1><ol start='' ><li><p><span>Connect 函数与非阻塞？</span></p></li><li><p><span>Accept函数与三次握手关系？</span></p><p><span>Accept函数是返回已经三次握手成功的socket</span></p></li><li><p><span>TIME_WAIT时长？为什么？如何取消？</span></p><p><a href='https://baijiahao.baidu.com/s?id=1654225744653405133&amp;wfr=spider&amp;for=pc'><span>详解 TCP 连接的“ 三次握手 ”与“ 四次挥手 ”</span></a><span>、</span><a href='https://www.cnblogs.com/AhuntSun-blog/p/12028636.html'><span>详解TCP连接的“三次握手”与“四次挥手”(上)</span></a><span>、</span><a href='https://www.cnblogs.com/AhuntSun-blog/p/12037852.html'><span>详解TCP连接的“三次握手”与“四次挥手”(下)</span></a></p></li><li><p><span>报文的最大生存期与那些因素有关？</span></p><p><a href='https://blog.csdn.net/weixin_42764391/article/details/99820386'><span>MSL(Maximum Segment Lifetime)报文最大生存时间</span></a><span>、</span><a href='https://blog.csdn.net/u013074465/article/details/45097183'><span>网络术语MSL/TTL/RTT</span></a></p></li><li><p><span>tcp的握手挥手过程？（详细）tcp为什么要连接？tcp建立连接这里你是怎么理解的？</span></p></li><li><p><span>半连接队列？全连接队列？</span></p><p><a href='http://jm.taobao.org/2017/05/25/525-1/'><span>关于TCP 半连接队列和全连接队列</span></a><span>、</span><a href='https://cjting.me/2019/08/28/tcp-queue/'><span>从一次 Connection Reset 说起，TCP 半连接队列与全连接队列</span></a><span>、</span><a href='https://juejin.im/post/5e01a5886fb9a016510db122'><span>TCP的全连接和半连接队列</span></a><span>、</span><a href='https://blog.csdn.net/yangguosb/article/details/90644683'><span>TCP半连接队列和全连接队列</span></a><span>、</span><a href='https://www.cnblogs.com/xiaolincoding/p/12995358.html'><span>TCP 半连接队列和全连接队列满了会发生什么？又该如何应对？</span></a></p></li><li><p><span>tcp流量控制和拥塞控制？输层发生拥塞，在应用层的表现是什么</span></p><p><a href='https://zhuanlan.zhihu.com/p/37379780'><span>TCP流量控制、拥塞控制</span></a><span>、</span><a href='https://andrewpqc.github.io/2018/07/21/tcp-flow-control-and-congestion-control/'><span>TCP流量控制与拥塞控制</span></a><span>、</span><a href='https://blog.csdn.net/liaoqianwen123/article/details/25429143'><span>TCP的流量控制和拥塞控制</span></a><span>、</span><a href='https://troywu0.gitbooks.io/spark/content/tcp%E6%B5%81%E9%87%8F%E6%8E%A7%E5%88%B6%EF%BC%8C%E6%8B%A5%E5%A1%9E%E6%8E%A7%E5%88%B6%E5%92%8C%E5%8F%AF%E9%9D%A0%E4%BC%A0%E8%BE%93.html'><span>tcp流量控制，拥塞控制和可靠传输</span></a></p></li><li><p><span>网络编程里的reactor模型介绍下</span></p></li><li><p><span>time_wait状态？为什么是2msl？</span></p></li><li><p><span>有很多close_wait怎么解决？</span></p><p><a href='https://blog.csdn.net/wwd0501/article/details/78674170'><span>TCP CLOSE_WAIT 过多解决方案</span></a><span>、</span><a href='https://blog.csdn.net/yu616568/article/details/44677985'><span>一次服务端大量CLOSE_WAIT问题的解决</span></a><span>、</span><a href='https://juejin.im/post/5c0cf1ed6fb9a04a08217fcc'><span>线上大量CLOSE_WAIT的原因深入分析</span></a><span>、</span><a href='https://www.zybuluo.com/zhongdao/note/1450198'><span>CLOSE_WAIT连接过多的现象分析与处理</span></a></p></li><li><p><span>udp为什么是不可靠的？bind和connect对于udp的作用是什么？</span></p></li><li><p><span>NAT是什么？底层实现原理？</span></p></li><li><p><span>对于使用tcp通信的两端，如果client已经退出，此时服务端继续send会出现什么问题？这个当然就要扯到SIGPIPE信号了？</span></p></li><li><p><span>DDOS攻击原理</span></p></li><li><p><span>http/https协议，cookie/session、输入url发生了什么；</span></p></li><li><p><span>https，非对称加密，通信中怎么弄？为什么通信前用非对称加密，通信中要用对称？为什么不一直用非对称？</span></p></li><li><p><span>xss了解吗？</span></p></li><li><p><span>TCP与UDP什么关系？</span></p></li><li><p><span>tls和ssl什么区别？</span></p></li><li><p><span>TCP怎样发现数据丢了，丢了会怎样处理？TCP的全双工怎么理解？TCP一端还在发但是另一端已经关闭了怎么办，就是我知道对面已经关闭连接了但是我还要向他发数据，在应用层该怎么处理？</span></p></li><li><p><span>什么叫面向流、面向报文？</span></p></li><li><p><span>UDP发送到应用层的一条数据有可能会被拆分成多个数据包吗？</span></p></li><li><p><span>http1.0/1.1 和 http2.0的区别?post和get的区别?</span></p></li><li><p><span>dns 的解析过程，DHCP</span></p></li><li><p><span>大端和小端存储概念；</span></p></li><li><p><span>使用sendto发送大小为1024B的UDP报文，使用recvfrom每次接收64B数据，一个while循环是否能取得所有数据？</span></p><p><span> </span><a href='https://blog.csdn.net/stpeace/article/details/73893884'><span>关于udp socket recvfrom函数的一个易错问题： 如果应用程序指定的接收长度不够怎么办？</span></a><span>、</span><a href='https://cloud.tencent.com/developer/article/1004554'><span>告知你不为人知的 UDP：疑难杂症和使用</span></a></p></li><li><p><span>路由表的问题</span></p></li><li><p><span>网络各层校验用的什么？ ARP协议？</span></p></li><li><p><span>问linux网络驱动的实现步骤</span></p></li><li><p><span>网络故障如何查看网络状态？</span></p></li><li><p><span>实现一个网络库有哪些要点？</span></p></li><li><p><span>硬件地址和ip地址的区别。</span></p></li><li><p><span>网络协议栈的理解</span></p><p><span>  </span><a href='https://www.cnblogs.com/sammyliu/p/5225623.html'><span>理解 Linux 网络栈（1）：Linux 网络协议栈简单总结</span></a><span>、</span><a href='https://segmentfault.com/a/1190000021227338'><span>如何学习 Linux 内核网络协议栈</span></a><span>、</span><a href='https://www.ibm.com/developerworks/cn/linux/l-linux-networking-stack/'><span>Linux 网络栈剖析</span></a><span>、</span><a href='https://www.jianshu.com/p/75c7f1a0a4e7'><span>重头梳理网络协议栈</span></a><span>、</span><a href='https://blog.csdn.net/lee244868149/article/details/71248999'><span>了解linux网络协议栈（四）——协议栈实现</span></a><span>、</span><a href='https://www.cnblogs.com/agilestyle/p/11394930.html'><span>Linux网络栈</span></a><span>、</span><a href='https://www.zhihu.com/topic/20070536/hot'><span>协议栈</span></a></p></li><li><p><span>服务器启动到接受连接的整过过程锁调用的函数</span></p></li><li><p><span>出现丢包的情况，服务端发现重复ack，在socket层面的表现是？可以通过什么函数获取到对应的信息？</span></p></li><li><p><span>有没有了解其他开源网络库？了解协程网络库吗？</span></p></li><li><p><span>网络抓包用什么工具？wireshark，tcpdump</span></p></li><li><p><span>arp协议是那一层的？arp协议是干什么的？</span></p><p><span> arp是属于网络层，用于将ip得知解析成mac地址</span></p></li><li><p><span>icmp协议分别位于哪层</span></p><p><span> 网络层（ip层）</span></p></li><li><p><span>traceroute原理</span></p><p><span> tranceroute使用IPv4的TTL字段或IPv6的跳线字段以及两种ICMP消息。它一开始向目的地发送一个TTL（或跳限）为1的UDP数据报。这个数据报导致第一跳路由器返回一个ICMP &quot;time exceeded in transmit&quot;（传输中超时）错误。接着它每递增TTL一次发送一个UDP数据报，从而逐步确定下一跳路由器。当某个UDP数据报达到最终目的地时，目标是由这个这个主机返回一个ICMP &quot;port unreachable&quot;（端口不可达）错误。这个目标通过向一个随机选取的（但愿）未被目的主机使用的端口发送UDP数据报得以实现。</span></p></li><li><p><span>集群和分布式有什么区别</span></p></li><li><p><span>HTML怎么优化</span></p></li><li><p><span>cookies 和session区别和作用</span></p></li><li><p><span>黏包问题</span></p><p><span> </span><a href='https://blog.csdn.net/tiandijun/article/details/41961785'><span>TCP粘包问题分析和解决（全）</span></a><span>、</span><a href='https://www.zhihu.com/question/20210025'><span>怎么解决TCP网络传输「粘包」问题？</span></a><span>、</span><a href='http://www.hchstudio.cn/article/2018/d5b3/'><span>Socket 中粘包问题浅析及其解决方案</span></a><span>、</span><a href='https://draveness.me/whys-the-design-tcp-message-frame/'><span>为什么 TCP 协议有粘包问题</span></a><span>、</span><a href='https://www.cnblogs.com/wade-luffy/p/6165671.html'><span>TCP粘包/拆包问题</span></a><span>、</span><a href='https://www.cnblogs.com/QG-whz/p/5537447.html'><span>Socket编程（4）TCP粘包问题及解决方案</span></a></p></li><li><p><span>UDP可靠传输实现</span></p></li><li><p><span>数据包mtu(最大传输单元)</span></p><p><span> </span><a href='https://blog.csdn.net/qq_26093511/article/details/78739198'><span>TCP/IP协议：最大传输单元MTU 和 最大分段大小MSS (TCP的分段和IP的分片)</span></a><span>、</span><a href='https://www.jianshu.com/p/678f5e79dd71'><span>MTU最大传输单元</span></a><span>、</span></p></li><li><p><span>UDP广播IP段？</span></p></li><li><p><span>socket中 bind() accept()之后的状态</span></p></li><li><p><span>如果有很多从客户端发来的请求，结果大量的失败，分析原因</span>
<span>  我说了网络，I/O，后来他又问从操作系统层面考虑，我说是不是socket占用了大量的端口号，然后又问端口号的最大个数</span></p></li><li><p><span>数据从应用层  到  传输层  到  IP层 到  链路层，每一层涉及的具体的操作有哪些？</span></p></li><li><p><span>TCP UDP IP首部多大</span></p><p><span> </span><a href='https://blog.csdn.net/caoshangpa/article/details/51530685'><span>TCP、UDP数据包大小的限制</span></a><span>、</span><a href='https://blog.csdn.net/zhangliangzi/article/details/52554439'><span>IP、TCP、UDP首部详解</span></a></p></li><li><p><span>服务器方，如果两个进程同时占用80端口，客户端的HTTP报文怎么处理？会报错吗？</span></p></li><li><p><span>如何判断机器是大端存储还是小端存储，如何将大端转换成小端？</span></p></li><li><p><span>路由协议 RIP，netstat 显示哪些东西</span></p></li></ol><hr /><h1 id='数据结构与算法'><span>数据结构与算法</span></h1><ol start='' ><li><span>斐波那契数列的非递归写法？</span></li><li><span>一个整数数组，可能是降序或升序，也可能是先升序再降序，求最大值？（几秒后就让我赶紧说思路）</span></li><li><span>写代码：单链表，求中部的N个节点的头节点和尾节点？（需要写测试用例）</span></li><li><span>一致性hash？</span></li><li><span>判断输入的数据是不是合法分float类型数据（自动机）</span></li><li><span>手撕平衡二叉树</span></li><li><span>LRU实现</span></li><li><span>了解哪些数据结构？</span></li><li><span>说一下二分查找的思想，二分查找用递归实现，递归有什么缺点？</span></li><li><span>用过hash表吗？我说只在unoedered_map容器里用过，就没再问</span></li><li><span>给一个整数，得到它的开根号的值。怎么实现这个函数？</span></li><li><span>快排什么时候会退化？随机法；二路快排</span></li><li><span>哈希了解过吗？设计一个哈希算法，考虑什么？（哈希冲突少，其他的还有吗）怎么让哈希算法冲突更少，有没有什么策略？</span></li><li><span>为什么数据规模较小的时候可以采用插入排序？</span></li><li><span>为什么在实现一个快排的时候，比如STL，实现快排，然后到一个规模的时候下选择插入，有什么考量的点</span></li><li><span>了解过哪些查询算法？</span></li><li><span>如何统计一篇文章中单词的频次。</span></li><li><span>查找一个关键字的时间复杂度？堆排序的时间复杂度？有没有比O(logn)更小时间复杂的的查找方法？</span></li><li><span>B 树是什么？平衡二叉树是什么？</span></li><li><span>快排是不是稳定的，有哪些排序方法是稳定的</span></li><li><span>B+树原理，红黑树原理</span></li><li><span>合并两个二叉树 算法思路</span></li><li><span>最小栈问题；</span></li><li><span>如何从100w个无序数中获取第K大的数？</span></li><li><span>红黑树最差旋转几次</span></li><li><span>红黑树和AVL数树区别?</span></li><li><span>设计哈希表，如何扩容</span></li><li><span>海量数据排序该怎么做</span></li><li><span>既然计数排序时间复杂度低，为什么它并不常用</span></li><li><span>海量数据找中位数</span></li><li><span>kmp算法以及复杂度</span></li><li><span>LFU逻辑上如何实现 要求访问是O(1)的</span></li><li><span>红黑树和AVL树，红黑树的平衡因子？？？</span></li><li><span>最小生成树算法？图的广度优先遍历用到的是什么数据结构？</span></li></ol><hr /><h1 id='设计模式'><span>设计模式</span></h1><ol start='' ><li><span>学过什么设计模式，简述？了解设计原则吗?</span></li><li><span>线程安全的单例模型怎么实现?</span></li></ol><hr /><h1 id='编译原理'><span>编译原理</span></h1><ol start='' ><li><span>动态编译和静态编译</span></li><li><span>编译时链接有几种方式: 静态链接和动态链接的区别?</span></li><li><span>动态链接库和静态链接库的链接时机，预处理、编译还是其他阶段？</span></li><li><span>如果动态链接库A，动态链接库B，里面都有一个名为function的函数，函数名相同，函数具体定义内容不同，程序链接阶段，怎么才能确定链接哪个函数。</span></li></ol><hr /><h1 id='linux'><span>Linux</span></h1><ol start='' ><li><span>linux查看端口命令：</span><code>lsof -i</code></li><li><span>gdb用过吗，如何查看调用栈（bt，backtrace)</span></li><li><span>常用的linux命令，top,netstat,df,free,strace,pstack</span></li><li><span>cpu占用过高了，如何排查？（不知道）</span></li><li><span>程序crash了，如何排查？（不知道）</span></li></ol><hr /><h1 id='嵌入式'><span>嵌入式</span></h1><ol start='' ><li><span>问PSRAM、SDRAM、DDR、DDR2的时序特性？I2C触摸屏芯片与CPU的数据传输流程？画出相关图例？</span></li><li><span>uboot启动时为什么要关闭中断，Icache有什么好处。</span></li></ol><hr /><h1 id='其他'><span>其他</span></h1><ol start='' ><li><span>微服务的架构、框架的实现、服务治理、分布式一致性</span></li><li><span>日志监控系统，考察架构，ELK的相关知识，重点描述Elasticsearch的一些架构原理，比如倒排索引的原理；</span></li><li><span>问消息队列的相关知识，接触过Kafka，问了Kafka中消息可以被多个消费者消费吗？；以及选举机制和HW机制；</span></li><li><span>数据库和Redis相关问题，数据库考察索引的原理以及几种事务的区别。Redis问数据结构，延时队列如何实现，分布式锁原理；</span></li><li><span>负载均衡算法；</span></li><li><span>ngnix如何做限流；</span></li><li><span>四层LVS和七层Ngnix的区别；</span></li><li><span>秒杀系统的如何设计，分接入层、接口层、消息队列层、逻辑层四个方面讲解，接入层可以做服务治理相关事情，接口层做抢购开关、黑白名单、随机拒绝等处理，逻辑层具体抢购逻辑实现，涉及到redis分布式锁以及DB和Redis的一致性问题。从秒杀系统还引申出分布式事务的几种实现，二段式、三段式、补偿型(TCC)、基于可靠消息服务的消息队列实现。重点讨论了这几种的实现和区别，要求画出基于可靠消息服务的消息队列实现分布式事务的架构图，以及上游服务和下游服务如何保证消息可靠性和一致性。</span></li><li><span>考察服务治理，服务限流算法，服务降级的指标和恢复指标，服务熔断。</span></li><li><span>共享桌面用你熟悉的任意画图工具画项目架构图？</span></li><li><span>项目中遇到缓存穿透问题怎么处理？</span></li><li><span>ZooKeeper</span></li><li><span>如何调试服务器？</span></li><li><span>rpc，taf框架库</span></li><li><span>UML</span></li><li><span>给定一堆url，用于查找，怎么做？</span></li><li><span>事务管理（ACID）</span></li><li><span>浏览器输入一个URL会经历一些什么步骤？</span></li><li><span>为啥第二次打开页面会比第一次快？</span></li><li><span>大数相乘</span></li><li><span>nginx的网络模型，IO多路复用</span></li><li><span>状态机；行为树；</span></li><li><span>每秒有2w qq号登陆，怎么找出每小时登陆次数5-10次的所有qq号(实时)？</span></li><li><span>cdn业务的问题，</span></li><li><span>如果用户访问的缓存节点没有资源，怎么办？自然是向父节点寻找资源，父节点没有继续向父节点查找，直到找到源站。</span></li><li><span>用户访问的域名和缓存节点向父节点访问的域名一样吗？</span></li><li><span>十亿字符串中查找一个字符串是否存在，bitmap、布隆过滤器，失误率，如何降低</span></li><li><span>protobuf</span></li><li><span>Asio </span></li><li><span>分布式和高可用性什么关系？</span></li><li><span>10TB数据找TOP100</span></li></ol></div></div>

<script>(function(){var e=document.body.parentElement,t=[],n=null,i=document.body.classList.contains("typora-export-collapse-outline"),r=function(e,t,n){document.addEventListener(e,function(e){if(!e.defaultPrevented)for(var i=e.target;i&&i!=this;i=i.parentNode)if(i.matches(t)){!1===n.call(i,e)&&(e.preventDefault(),e.stopPropagation());break}},!1)};function o(){return e.scrollTop}r("click",".outline-expander",function(e){var t=this.closest(".outline-item-wrapper").classList;return t.contains("outline-item-open")?t.remove("outline-item-open"):t.add("outline-item-open"),d(),!1}),r("click",".outline-item",function(e){var t=this.querySelector(".outline-label");if(location.hash="#"+t.getAttribute("href"),i){var n=this.closest(".outline-item-wrapper").classList;n.contains("outline-item-open")||n.add("outline-item-open"),c(),n.add("outline-item-active")}});var a,s,l=function(){var e=o();n=null;for(var i=0;i<t.length&&t[i][1]-e<60;i++)n=t[i]},c=function(){document.querySelectorAll(".outline-item-active").forEach(e=>e.classList.remove("outline-item-active")),document.querySelectorAll(".outline-item-single.outline-item-open").forEach(e=>e.classList.remove("outline-item-open"))},d=function(){if(n){c();var e=document.querySelector('.outline-label[href="#'+(CSS.escape?CSS.escape(n[0]):n[0])+'"]');if(e)if(i){var t=e.closest(".outline-item-open>ul>.outline-item-wrapper");if(t)t.classList.add("outline-item-active");else{for(var r=(e=e.closest(".outline-item-wrapper")).parentElement.closest(".outline-item-wrapper");r;)r=(e=r).parentElement.closest(".outline-item-wrapper");e.classList.add("outline-item-active")}}else e.closest(".outline-item-wrapper").classList.add("outline-item-active")}};window.addEventListener("scroll",function(e){a&&clearTimeout(a),a=setTimeout(function(){l(),d()},300)});var u=function(){s=setTimeout(function(){!function(){t=[];var e=o();document.querySelector("#write").querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(n=>{var i=n.getAttribute("id");t.push([i,e+n.getBoundingClientRect().y])})}(),l(),d()},300)};window.addEventListener("resize",function(e){s&&clearTimeout(s),u()}),u()})();</script><script src="/js/typora-convert.js"></script>
</body>
</html>